/******************************************************************
*
*	CyberLink for C
*
*	Copyright (C) Satoshi Konno 2005
*
*       Copyright (C) 2006 Nokia Corporation. All rights reserved.
*
*       This is licensed under BSD-style license,
*       see file COPYING.
*
*	File: cservice_notify.c
*
*	Revision:
*
*	06/21/05
*		- first revision
*
******************************************************************/

#include <cybergarage/upnp/cservice.h>
#include <cybergarage/util/clog.h>

/****************************************
* CG_UPNP_USE_STDDCP (Begin)
****************************************/

#if defined(CG_UPNP_USE_STDDCP)

/****************************************
 * Service Description (Content Directory)
 ****************************************/

static char *CG_UPNP_AV_CONTENTDIRECTORY_SERVICE_DESCRIPTION = 
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<scpd xmlns=\"urn:schemas-upnp-org:service-1-0\">\n"
"   <specVersion>\n"
"      <major>1</major>\n"
"      <minor>0</minor>\n"
"   </specVersion>\n"
"   <actionList>\n"
"      <action>\n"
"         <name>ExportResource</name>\n"
"         <argumentList>\n"
"            <argument>\n"
"               <name>SourceURI</name>\n"
"               <direction>in</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_URI</relatedStateVariable>\n"
"            </argument>\n"
"            <argument>\n"
"               <name>DestinationURI</name>\n"
"               <direction>in</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_URI</relatedStateVariable>\n"
"            </argument>\n"
"            <argument>\n"
"               <name>TransferID</name>\n"
"               <direction>out</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_TransferID</relatedStateVariable>\n"
"            </argument>\n"
"         </argumentList>\n"
"      </action>\n"
"      <action>\n"
"         <name>StopTransferResource</name>\n"
"         <argumentList>\n"
"            <argument>\n"
"               <name>TransferID</name>\n"
"               <direction>in</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_TransferID</relatedStateVariable>\n"
"            </argument>\n"
"         </argumentList>\n"
"      </action>\n"
"      <action>\n"
"         <name>DestroyObject</name>\n"
"         <argumentList>\n"
"            <argument>\n"
"               <name>ObjectID</name>\n"
"               <direction>in</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_ObjectID</relatedStateVariable>\n"
"            </argument>\n"
"         </argumentList>\n"
"      </action>\n"
"      <action>\n"
"         <name>DeleteResource</name>\n"
"         <argumentList>\n"
"            <argument>\n"
"               <name>ResourceURI</name>\n"
"               <direction>in</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_URI</relatedStateVariable>\n"
"            </argument>\n"
"         </argumentList>\n"
"      </action>\n"
"      <action>\n"
"         <name>UpdateObject</name>\n"
"         <argumentList>\n"
"            <argument>\n"
"               <name>ObjectID</name>\n"
"               <direction>in</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_ObjectID</relatedStateVariable>\n"
"            </argument>\n"
"            <argument>\n"
"               <name>CurrentTagValue</name>\n"
"               <direction>in</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_TagValueList</relatedStateVariable>\n"
"            </argument>\n"
"            <argument>\n"
"               <name>NewTagValue</name>\n"
"               <direction>in</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_TagValueList</relatedStateVariable>\n"
"            </argument>\n"
"         </argumentList>\n"
"      </action>\n"
"      <action>\n"
"         <name>Browse</name>\n"
"         <argumentList>\n"
"            <argument>\n"
"               <name>ObjectID</name>\n"
"               <direction>in</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_ObjectID</relatedStateVariable>\n"
"            </argument>\n"
"            <argument>\n"
"               <name>BrowseFlag</name>\n"
"               <direction>in</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_BrowseFlag</relatedStateVariable>\n"
"            </argument>\n"
"            <argument>\n"
"               <name>Filter</name>\n"
"               <direction>in</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_Filter</relatedStateVariable>\n"
"            </argument>\n"
"            <argument>\n"
"               <name>StartingIndex</name>\n"
"               <direction>in</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_Index</relatedStateVariable>\n"
"            </argument>\n"
"            <argument>\n"
"               <name>RequestedCount</name>\n"
"               <direction>in</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_Count</relatedStateVariable>\n"
"            </argument>\n"
"            <argument>\n"
"               <name>SortCriteria</name>\n"
"               <direction>in</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_SortCriteria</relatedStateVariable>\n"
"            </argument>\n"
"            <argument>\n"
"               <name>Result</name>\n"
"               <direction>out</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_Result</relatedStateVariable>\n"
"            </argument>\n"
"            <argument>\n"
"               <name>NumberReturned</name>\n"
"               <direction>out</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_Count</relatedStateVariable>\n"
"            </argument>\n"
"            <argument>\n"
"               <name>TotalMatches</name>\n"
"               <direction>out</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_Count</relatedStateVariable>\n"
"            </argument>\n"
"            <argument>\n"
"               <name>UpdateID</name>\n"
"               <direction>out</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_UpdateID</relatedStateVariable>\n"
"            </argument>\n"
"         </argumentList>\n"
"      </action>\n"
"      <action>\n"
"         <name>GetTransferProgress</name>\n"
"         <argumentList>\n"
"            <argument>\n"
"               <name>TransferID</name>\n"
"               <direction>in</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_TransferID</relatedStateVariable>\n"
"            </argument>\n"
"            <argument>\n"
"               <name>TransferStatus</name>\n"
"               <direction>out</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_TransferStatus</relatedStateVariable>\n"
"            </argument>\n"
"            <argument>\n"
"               <name>TransferLength</name>\n"
"               <direction>out</direction>\n"
"               <relatedStateVariable>A_ARG_TYPE_TransferLength</relatedStateVariable>\n"
"            </argument>\n"
"             <argument>\n"
"                <name>TransferTotal</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_TransferTotal</relatedStateVariable>\n"
"             </argument>\n"
"          </argumentList>\n"
"       </action>\n"
"       <action>\n"
"          <name>GetSearchCapabilities</name>\n"
"          <argumentList>\n"
"             <argument>\n"
"                <name>SearchCaps</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>SearchCapabilities</relatedStateVariable>\n"
"             </argument>\n"
"          </argumentList>\n"
"       </action>\n"
"       <action>\n"
"          <name>CreateObject</name>\n"
"          <argumentList>\n"
"             <argument>\n"
"                <name>ContainerID</name>\n"
"                <direction>in</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_ObjectID</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>Elements</name>\n"
"                <direction>in</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_Result</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>ObjectID</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_ObjectID</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>Result</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_Result</relatedStateVariable>\n"
"             </argument>\n"
"          </argumentList>\n"
"       </action>\n"
"       <action>\n"
"          <name>Search</name>\n"
"          <argumentList>\n"
"             <argument>\n"
"                <name>ContainerID</name>\n"
"                <direction>in</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_ObjectID</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>SearchCriteria</name>\n"
"                <direction>in</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_SearchCriteria</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>Filter</name>\n"
"                <direction>in</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_Filter</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>StartingIndex</name>\n"
"                <direction>in</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_Index</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>RequestedCount</name>\n"
"                <direction>in</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_Count</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>SortCriteria</name>\n"
"                <direction>in</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_SortCriteria</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>Result</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_Result</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>NumberReturned</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_Count</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>TotalMatches</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_Count</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>UpdateID</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_UpdateID</relatedStateVariable>\n"
"             </argument>\n"
"          </argumentList>\n"
"       </action>\n"
"       <action>\n"
"          <name>GetSortCapabilities</name>\n"
"          <argumentList>\n"
"             <argument>\n"
"                <name>SortCaps</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>SortCapabilities</relatedStateVariable>\n"
"             </argument>\n"
"          </argumentList>\n"
"       </action>\n"
"       <action>\n"
"          <name>ImportResource</name>\n"
"          <argumentList>\n"
"             <argument>\n"
"                <name>SourceURI</name>\n"
"                <direction>in</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_URI</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>DestinationURI</name>\n"
"                <direction>in</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_URI</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>TransferID</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_TransferID</relatedStateVariable>\n"
"             </argument>\n"
"          </argumentList>\n"
"       </action>\n"
"       <action>\n"
"          <name>CreateReference</name>\n"
"          <argumentList>\n"
"             <argument>\n"
"                <name>ContainerID</name>\n"
"                <direction>in</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_ObjectID</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>ObjectID</name>\n"
"                <direction>in</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_ObjectID</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>NewID</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_ObjectID</relatedStateVariable>\n"
"             </argument>\n"
"          </argumentList>\n"
"       </action>\n"
"       <action>\n"
"          <name>GetSystemUpdateID</name>\n"
"          <argumentList>\n"
"             <argument>\n"
"                <name>Id</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>SystemUpdateID</relatedStateVariable>\n"
"             </argument>\n"
"          </argumentList>\n"
"       </action>\n"
"    </actionList>\n"
"    <serviceStateTable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_SortCriteria</name>\n"
"          <dataType>string</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_TransferLength</name>\n"
"          <dataType>string</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"yes\">\n"
"          <name>TransferIDs</name>\n"
"          <dataType>string</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_UpdateID</name>\n"
"          <dataType>ui4</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_SearchCriteria</name>\n"
"          <dataType>string</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_Filter</name>\n"
"          <dataType>string</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"yes\">\n"
"          <name>ContainerUpdateIDs</name>\n"
"          <dataType>string</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_Result</name>\n"
"          <dataType>string</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_Index</name>\n"
"          <dataType>ui4</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_TransferID</name>\n"
"          <dataType>ui4</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_TagValueList</name>\n"
"          <dataType>string</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_URI</name>\n"
"          <dataType>uri</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_ObjectID</name>\n"
"          <dataType>string</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>SortCapabilities</name>\n"
"          <dataType>string</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>SearchCapabilities</name>\n"
"          <dataType>string</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_Count</name>\n"
"          <dataType>ui4</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_BrowseFlag</name>\n"
"          <dataType>string</dataType>\n"
"          <allowedValueList>\n"
"             <allowedValue>BrowseMetadata</allowedValue>\n"
"             <allowedValue>BrowseDirectChildren</allowedValue>\n"
"          </allowedValueList>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"yes\">\n"
"          <name>SystemUpdateID</name>\n"
"          <dataType>ui4</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_TransferStatus</name>\n"
"          <dataType>string</dataType>\n"
"          <allowedValueList>\n"
"             <allowedValue>COMPLETED</allowedValue>\n"
"             <allowedValue>ERROR</allowedValue>\n"
"             <allowedValue>IN_PROGRESS</allowedValue>\n"
"             <allowedValue>STOPPED</allowedValue>\n"
"          </allowedValueList>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_TransferTotal</name>\n"
"          <dataType>string</dataType>\n"
"       </stateVariable>\n"
"    </serviceStateTable>\n"
" </scpd>\n";

static char *CG_UPNP_AV_CONNECTIONMANAGER_SERVICE_DESCRIPTION = 
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<scpd xmlns=\"urn:schemas-upnp-org:service-1-0\">\n"
"   <specVersion>\n"
"      <major>1</major>\n"
"      <minor>0</minor>\n"
"   </specVersion>\n"
"   <actionList>\n"
"      <action>\n"
"         <name>GetCurrentConnectionInfo</name>\n"
"          <argumentList>\n"
"             <argument>\n"
"                <name>ConnectionID</name>\n"
"                <direction>in</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_ConnectionID</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>RcsID</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_RcsID</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>AVTransportID</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_AVTransportID</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>ProtocolInfo</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_ProtocolInfo</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>PeerConnectionManager</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_ConnectionManager</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>PeerConnectionID</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_ConnectionID</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>Direction</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_Direction</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>Status</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>A_ARG_TYPE_ConnectionStatus</relatedStateVariable>\n"
"             </argument>\n"
"          </argumentList>\n"
"       </action>\n"
"       <action>\n"
"          <name>GetProtocolInfo</name>\n"
"          <argumentList>\n"
"             <argument>\n"
"                <name>Source</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>SourceProtocolInfo</relatedStateVariable>\n"
"             </argument>\n"
"             <argument>\n"
"                <name>Sink</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>SinkProtocolInfo</relatedStateVariable>\n"
"             </argument>\n"
"          </argumentList>\n"
"       </action>\n"
"       <action>\n"
"          <name>GetCurrentConnectionIDs</name>\n"
"          <argumentList>\n"
"             <argument>\n"
"                <name>ConnectionIDs</name>\n"
"                <direction>out</direction>\n"
"                <relatedStateVariable>CurrentConnectionIDs</relatedStateVariable>\n"
"             </argument>\n"
"          </argumentList>\n"
"       </action>\n"
"    </actionList>\n"
"    <serviceStateTable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_ProtocolInfo</name>\n"
"          <dataType>string</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_ConnectionStatus</name>\n"
"          <dataType>string</dataType>\n"
"          <allowedValueList>\n"
"             <allowedValue>OK</allowedValue>\n"
"             <allowedValue>ContentFormatMismatch</allowedValue>\n"
"             <allowedValue>InsufficientBandwidth</allowedValue>\n"
"             <allowedValue>UnreliableChannel</allowedValue>\n"
"             <allowedValue>Unknown</allowedValue>\n"
"          </allowedValueList>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_AVTransportID</name>\n"
"          <dataType>i4</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_RcsID</name>\n"
"          <dataType>i4</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_ConnectionID</name>\n"
"          <dataType>i4</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_ConnectionManager</name>\n"
"          <dataType>string</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"yes\">\n"
"          <name>SourceProtocolInfo</name>\n"
"          <dataType>string</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"yes\">\n"
"          <name>SinkProtocolInfo</name>\n"
"          <dataType>string</dataType>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"no\">\n"
"          <name>A_ARG_TYPE_Direction</name>\n"
"          <dataType>string</dataType>\n"
"          <allowedValueList>\n"
"             <allowedValue>Input</allowedValue>\n"
"             <allowedValue>Output</allowedValue>\n"
"          </allowedValueList>\n"
"       </stateVariable>\n"
"       <stateVariable sendEvents=\"yes\">\n"
"          <name>CurrentConnectionIDs</name>\n"
"          <dataType>string</dataType>\n"
"       </stateVariable>\n"
"    </serviceStateTable>\n"
" </scpd>\n";

static char *CG_UPNP_AV_AVTRANSPORT_SERVICE_DESCRIPTION = 
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<scpd xmlns=\"urn:schemas-upnp-org:service-1-0\">\n"
"     <serviceStateTable> \n"
"         <stateVariable> \n"
"             <name>TransportState</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"             <allowedValueList> \n"
"                 <allowedValue>STOPPED</allowedValue> \n"
"                 <allowedValue>PLAYING</allowedValue> \n"
"             </allowedValueList> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>TransportStatus</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"             <allowedValueList> \n"
"                 <allowedValue>OK</allowedValue> \n"
"                 <allowedValue>ERROR_OCCURRED</allowedValue>            \n"
"             </allowedValueList> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>PlaybackStorageMedium</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"         </stateVariable> \n"
" 	 <stateVariable> \n"
"             <name>RecordStorageMedium</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"               </stateVariable> \n"
"         <stateVariable> \n"
"             <name>PossiblePlaybackStorageMedia</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>PossibleRecordStorageMedia</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>CurrentPlayMode</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"             <allowedValueList> \n"
"                 <allowedValue>NORMAL</allowedValue> \n"
"             </allowedValueList> \n"
"             <defaultValue>NORMAL</defaultValue> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>TransportPlaySpeed</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
" 	<allowedValueList> \n"
"                 <allowedValue>1</allowedValue> \n"
"             </allowedValueList> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <name>RecordMediumWriteStatus </name> \n"
"             <dataType>string</dataType> \n"
"          </stateVariable> \n"
"         <stateVariable> \n"
"             <name>CurrentRecordQualityMode</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"           </stateVariable> \n"
"         <stateVariable> \n"
"             <name>PossibleRecordQualityModes</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>NumberOfTracks</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>ui4</dataType> \n"
" 		<allowedValueRange> \n"
" 			<minimum>0</minimum> \n"
" 		</allowedValueRange> \n"
"          </stateVariable> \n"
"         <stateVariable> \n"
"             <name>CurrentTrack</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>ui4</dataType> \n"
" 		<allowedValueRange> \n"
" 			<minimum>0</minimum> \n"
" 			<step>1</step> \n"
" 		</allowedValueRange> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>CurrentTrackDuration</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"         </stateVariable> \n"
" 	  <stateVariable> \n"
"             <name>CurrentMediaDuration</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>CurrentTrackMetaData</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>CurrentTrackURI</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>AVTransportURI</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>AVTransportURIMetaData</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>NextAVTransportURI</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>NextAVTransportURIMetaData</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>RelativeTimePosition</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>AbsoluteTimePosition</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>RelativeCounterPosition</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>i4</dataType> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>AbsoluteCounterPosition</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>i4</dataType> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
" 		<Optional/> \n"
"             <name>CurrentTransportActions</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>LastChange</name> \n"
"             <sendEventsAttribute>yes</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>A_ARG_TYPE_SeekMode</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"             <allowedValueList> \n"
"                  <allowedValue>TRACK_NR</allowedValue> \n"
"             </allowedValueList> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>A_ARG_TYPE_SeekTarget</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>string</dataType> \n"
"         </stateVariable> \n"
"         <stateVariable> \n"
"             <name>A_ARG_TYPE_InstanceID</name> \n"
"             <sendEventsAttribute>no</sendEventsAttribute> \n"
"             <dataType>ui4</dataType> \n"
"         </stateVariable> \n"
"     </serviceStateTable> \n"
"     <actionList> \n"
"         <action> \n"
"             <name>SetAVTransportURI</name> \n"
"             <argumentList> \n"
"                 <argument> \n"
"                     <name>InstanceID</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>CurrentURI</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>AVTransportURI</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>CurrentURIMetaData</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>AVTransportURIMetaData</relatedStateVariable> \n"
"                 </argument> \n"
"             </argumentList> \n"
"         </action> \n"
"         <action>	<Optional/> \n"
"             <name>SetNextAVTransportURI</name> \n"
"             <argumentList> \n"
"                 <argument> \n"
"                     <name>InstanceID</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>NextURI</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>NextAVTransportURI</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>NextURIMetaData</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>NextAVTransportURIMetaData</relatedStateVariable> \n"
"                 </argument> \n"
"             </argumentList> \n"
"         </action> \n"
"         <action> \n"
"             <name>GetMediaInfo</name> \n"
"             <argumentList> \n"
"                 <argument> \n"
"                     <name>InstanceID</name> \n"
"                     <direction>in</direction>                 <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>NrTracks</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>NumberOfTracks</relatedStateVariable> \n"
"                 </argument> \n"
" <argument> \n"
"                     <name>MediaDuration</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>CurrentMediaDuration</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>CurrentURI</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>AVTransportURI</relatedStateVariable> \n"
"                 </argument> \n"
" 		    <argument> \n"
"                     <name>CurrentURIMetaData</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>AVTransportURIMetaData</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>NextURI</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>NextAVTransportURI</relatedStateVariable> \n"
"                 </argument> \n"
" 		    <argument> \n"
"                     <name>NextURIMetaData</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>NextAVTransportURIMetaData</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>PlayMedium</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>PlaybackStorageMedium</relatedStateVariable> \n"
"                 </argument> \n"
" <argument> \n"
"                     <name>RecordMedium</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>RecordStorageMedium</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>WriteStatus</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>RecordMediumWriteStatus </relatedStateVariable> \n"
"                 </argument> \n"
"             </argumentList> \n"
"         </action> \n"
"         <action> \n"
"             <name>GetTransportInfo</name> \n"
"             <argumentList> \n"
"                 <argument> \n"
"                     <name>InstanceID</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>CurrentTransportState</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>TransportState</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>CurrentTransportStatus</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>TransportStatus</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>CurrentSpeed</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>TransportPlaySpeed</relatedStateVariable> \n"
"                 </argument> \n"
"             </argumentList> \n"
"         </action> \n"
"         <action> \n"
"             <name>GetPositionInfo</name> \n"
"             <argumentList> \n"
"                 <argument> \n"
"                     <name>InstanceID</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>Track</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>CurrentTrack</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>TrackDuration</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>CurrentTrackDuration</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>TrackMetaData</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>CurrentTrackMetaData</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>TrackURI</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>CurrentTrackURI</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>RelTime</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>RelativeTimePosition</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>AbsTime</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>AbsoluteTimePosition</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>RelCount</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>RelativeCounterPosition</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>AbsCount</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>AbsoluteCounterPosition</relatedStateVariable> \n"
"                 </argument> \n"
"             </argumentList> \n"
"         </action> \n"
"         <action> \n"
"             <name>GetDeviceCapabilities</name> \n"
"             <argumentList> \n"
"                 <argument> \n"
"                     <name>InstanceID</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>PlayMedia</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>PossiblePlaybackStorageMedia</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>RecMedia</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>PossibleRecordStorageMedia</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>RecQualityModes</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>PossibleRecordQualityModes</relatedStateVariable> \n"
"                 </argument> \n"
"             </argumentList> \n"
"         </action> \n"
"         <action> \n"
"             <name>GetTransportSettings</name> \n"
"             <argumentList> \n"
"                 <argument> \n"
"                     <name>InstanceID</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>PlayMode</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>CurrentPlayMode</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>RecQualityMode</name> \n"
"                     <direction>out</direction>                 <relatedStateVariable>CurrentRecordQualityMode</relatedStateVariable> \n"
"                 </argument> \n"
"             </argumentList> \n"
"         </action> \n"
"         <action> \n"
"             <name>Stop</name> \n"
"             <argumentList> \n"
"                 <argument> \n"
"                     <name>InstanceID</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable> \n"
"                 </argument> \n"
"             </argumentList> \n"
"         </action> \n"
"         <action> \n"
"             <name>Play</name> \n"
"             <argumentList> \n"
"                 <argument> \n"
"                     <name>InstanceID</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>Speed</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>TransportPlaySpeed</relatedStateVariable> \n"
"                 </argument> \n"
"             </argumentList> \n"
"         </action> \n"
"         <action>	<Optional/> \n"
"             <name>Pause</name> \n"
"             <argumentList> \n"
"                 <argument> \n"
"                     <name>InstanceID</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable> \n"
"                 </argument> \n"
"             </argumentList> \n"
"         </action> \n"
"         <action>	<Optional/> \n"
"             <name>Record</name> \n"
"             <argumentList> \n"
"                 <argument> \n"
"                     <name>InstanceID</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable> \n"
"                 </argument> \n"
"             </argumentList> \n"
"         </action> \n"
"         <action> \n"
"             <name>Seek</name> \n"
"             <argumentList> \n"
"                 <argument> \n"
"                     <name>InstanceID</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>Unit</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>A_ARG_TYPE_SeekMode</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>Target</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>A_ARG_TYPE_SeekTarget</relatedStateVariable> \n"
"                 </argument> \n"
"             </argumentList> \n"
"         </action> \n"
"         <action> \n"
"             <name>Next</name> \n"
"             <argumentList> \n"
"                 <argument> \n"
"                     <name>InstanceID</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable> \n"
"                 </argument> \n"
"             </argumentList> \n"
"         </action> \n"
"         <action> \n"
"             <name>Previous</name> \n"
"             <argumentList> \n"
"                 <argument> \n"
"                     <name>InstanceID</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable> \n"
"                 </argument> \n"
"             </argumentList> \n"
"         </action> \n"
"         <action>	<Optional/> \n"
"             <name>SetPlayMode</name> \n"
"             <argumentList> \n"
"                 <argument> \n"
"                     <name>InstanceID</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>NewPlayMode</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>CurrentPlayMode</relatedStateVariable> \n"
"                 </argument> \n"
"             </argumentList> \n"
"         </action> \n"
"         <action>	<Optional/> \n"
"             <name>SetRecordQualityMode</name> \n"
"             <argumentList> \n"
"                 <argument> \n"
"                     <name>InstanceID</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>NewRecordQualityMode</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>CurrentRecordQualityMode</relatedStateVariable> \n"
"                 </argument> \n"
"             </argumentList> \n"
"         </action> \n"
"  \n"
"         <action>	<Optional/> \n"
"             <name>GetCurrentTransportActions</name> \n"
"             <argumentList> \n"
"                 <argument> \n"
"                     <name>InstanceID</name> \n"
"                     <direction>in</direction>                    <relatedStateVariable>A_ARG_TYPE_InstanceID</relatedStateVariable> \n"
"                 </argument> \n"
"                 <argument> \n"
"                     <name>Actions</name> \n"
"                     <direction>out</direction>                    <relatedStateVariable>CurrentTransportActions</relatedStateVariable> \n"
"                 </argument> \n"
"             </argumentList> \n"
"         </action> \n"
"     </actionList> \n"
" </scpd> \n";

/****************************************
 * cg_upnp_service_getstddcp
 ****************************************/

char *cg_upnp_service_getstddcp(CgUpnpService *service)
{
	char *serviceType = cg_upnp_service_getservicetype(service);
	if (cg_streq(serviceType, "urn:schemas-upnp-org:service:ContentDirectory:1"))
		return CG_UPNP_AV_CONTENTDIRECTORY_SERVICE_DESCRIPTION;
	if (cg_streq(serviceType, "urn:schemas-upnp-org:service:ConnectionManager:1"))
		return CG_UPNP_AV_CONNECTIONMANAGER_SERVICE_DESCRIPTION;
	if (cg_streq(serviceType, "urn:schemas-upnp-org:service:AVTransport:1"))
		return CG_UPNP_AV_AVTRANSPORT_SERVICE_DESCRIPTION;
	return NULL;
}

/****************************************
 * cg_upnp_service_hasstddcp
 ****************************************/
		
BOOL cg_upnp_service_hasstddcp(CgUpnpService *service)
{
	return (cg_upnp_service_getstddcp(service) != NULL) ? TRUE : FALSE;
}		
		
/****************************************
* CG_UPNP_USE_STDDCP (End)
****************************************/

#endif
